package cn.edu.hcnu.dao;

import java.sql.*;

public class empDao {
    String url="jdbc:mysql://localhost:orcl";
    String username="scott";
    String password="tiger";

    Connection conn=null;
    PreparedStatement pstmt=null;
    ResultSet rs=null;

    public  void conn() {
        try {
            Class.forName("mysql.jdbc.driver.mysqlDriver");
            conn= DriverManager.getConnection(url,username,password);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
    public  void Close(ResultSet re,PreparedStatement pstmt,Connection conn){
        try {
            rs.close();
            pstmt.close();
            conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
